package com.yasaka.stock.feign;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

import com.yasaka.stock.config.FeignMultipartSupportConfig;

@FeignClient(name = "Ocr", url = "http://ocr.dnax.iol8.com/api", configuration = FeignMultipartSupportConfig.class)
public interface OcrFeignClient {

	@RequestMapping(value = "/ocr/upload", method = RequestMethod.POST, consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
	public String upload(@RequestPart(value = "userFile") MultipartFile userFile);

	@RequestMapping(value = "/ocr/getContent", method = RequestMethod.GET)
	public String getContent(@RequestParam(value = "id") String id);

}